//
//  BSDefine.h
//  Baisijie
//
//  Created by 王建伟 on 2017/3/2.
//  Copyright © 2017年 RangGuangyu. All rights reserved.
//



#ifdef DEBUG

    #define BSString [NSString stringWithFormat:@"%s",__FILE__].lastPathComponent
    //#define BSLog(...) printf("%s: %s [第 %d 行] —— %s\n",CURRENTDATE, [BSString UTF8String], __LINE__, [[NSString stringWithFormat:__VA_ARGS__] UTF8String]);
    #define BSLog(...) {\
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];\
    \
    [dateFormatter setDateStyle:NSDateFormatterMediumStyle];\
    \
    [dateFormatter setTimeStyle:NSDateFormatterShortStyle];\
    \
    [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss:SSSS"]; \
    \
    NSString *str = [dateFormatter stringFromDate:[NSDate date]];\
    \
    printf("%s: %s [第 %d 行] —%s\n",[str UTF8String], [BSString UTF8String], __LINE__, [[NSString stringWithFormat:__VA_ARGS__] UTF8String]);\
    }

#else

    #define BSLog(...);

#endif

#define BSLogFunc BSLog(@"%s",__func__)

#define BSRGBColor(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)/1.0]
#define BSRandomColor BSRGBColor(arc4random_uniform(255), arc4random_uniform(255), arc4random_uniform(255), 1)

#define KScreenW [UIScreen mainScreen].bounds.size.width
#define KScreenH [UIScreen mainScreen].bounds.size.height

#define iPhone_3_5_inch (KScreenH == 480)
#define iPhone_4_0_inch (KScreenH == 568)
#define iPhone_4_7_inch (KScreenH == 667)
#define iPhone_5_5_inch (KScreenH == 736)

#define BSNotificationCenter [NSNotificationCenter defaultCenter]
#define BSUserDefaults [NSUserDefaults standardUserDefaults]

#define BSBundleDisplayName [NSBundle mainBundle].infoDictionary[@"CFBundleDisplayName"]





